<?php
if ( ! defined('ROOT')) exit('No direct script access allowed');

/**
 * 角色管理类
 * @author gzute
 * @link http://www.gzute.com
 * @E_mail gzute@qq.com
 */
Base::load_app_class('admin','admin');

class Role extends Admin
{
	private $form;
	
	public function __construct()
	{
		$this->form = Base::load_sys_class('validation');
		Base::load_model('role');
	}
	
	public function initAction()
	{
		$total = RoleModel::findBytotal();
		$params = array(
			'total' => $total,
			'type' => 2,
            'pagesize' => 1
		);
		Base::load_sys_func('pagination');
		$pa = new Pagination($params);
		$filter = $pa->filter();
		$data = RoleModel::findBypages($pa->offset,$pa->pagesize);
        self::tpl_assign('url',  site_url(array('m'=>'admin','c'=>'role','a'=>'lock')));
		self::tpl_assign('lists',$data);
        self::tpl_assign('filter', $filter);
        self::tpl_display('role');
	}
}
